/* eslint-disable */
// import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import filter from './filter'
// import Mock from './mock' //不再使用-注释掉 20211111 Z.X.X
// import appMock from './mock/app'//用于测试app方法,测试完可以注释此行
import 'babel-polyfill'
import 'normalize.css'
import '@/assets/common.css'
import FastClick from 'fastclick'
Vue.config.productionTip = false
import md5 from 'js-md5'
// import '@/utils/backtrack'
import { Lazyload } from 'vant';

// import './icons'

Vue.prototype.$md5 = md5

// 初始化vant图片懒加载
Vue.use(Lazyload, {
  lazyComponent: true,
  loading:'https://as.huaruisales.com/resources/haintell/selfManagement/posters-lists-lazy.png',
  attempt:20
});

// 初始化浏览器类型，设置系统、平台类型参数
store.dispatch('initSystemType')

// 全局过滤处理
filter.doFilters()

document.body.addEventListener('focusout',()=>{
  if(store.getters.getAppType === 'ios' || navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){
    window.scrollTo({
      top:0
    })
  }
})
// 是否使用MOCK接口
// if ('true' === process.env.VUE_APP_USE_MOCK) {
//   console.log('mock' + process.env.VUE_APP_USE_MOCK)
//   Mock.bootstrap()
// }
// fastclick优化
if ('addEventListener' in document && 'ontouchstart' in window) {
  FastClick.prototype.focus = function (targetElement) {
    targetElement.focus()
  }
  document.addEventListener('DOMContentLoaded', function () {
    FastClick.attach(document.body)
  }, false)
}
// appMock.doAppMock()//用于测试app方法,测试完可以注释此行
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')